# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=perl-anyevent
pkgver=7.14
pkgrel=3
epoch=4
pkgdesc='The DBI of event loop programming'
arch=('any')
url="https://metacpan.org/release/AnyEvent"
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('glib-perl' 'perl-async-interrupt' 'perl-ev' 'perl-net-ssleay')
optdepends=('perl-async-interrupt: for fast signal handling'
            'perl-ev: for the recommended EV event loop backend'
            'perl-guard: to speed up guards'
            'perl-json: send or receive JSON with AnyEvent::Handle'
            'perl-json-xs: send or receive JSON with AnyEvent::Handle'
            'perl-net-ssleay: TLS/SSL connections with AnyEvent::Handle')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/AnyEvent-$pkgver.tar.gz")
sha512sums=('98e7b9e06cf74b99d3407a25b60f3b825fceed3bae43505e1fb90785e24bd88ae25955cff25d29b4cc96957db7f4f5203d19ad2365abb4e3a3227fd91a16fb25')

build() {
  cd AnyEvent-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd AnyEvent-$pkgver
  PERL_ANYEVENT_LOOP_TESTS=true make test
}

package() {
  cd AnyEvent-$pkgver
  make DESTDIR="$pkgdir" install
}
